package com.jdk.learn.base;


/**

 for:形式的会在for循环外部生成一个局部变量，而非全局变量。且长度变量自定义到循环外部

 public class ForAndForColon {
 String[] str = new String[]{"1"};

 public ForAndForColon() {
 }

 public void forColonDemo() {
 String[] var1 = this.str;
 int var2 = var1.length;

 for(int var3 = 0; var3 < var2; ++var3) {
 String var10000 = var1[var3];
 }

 }

 public void forDemo() {
 for(int i = 0; i < this.str.length; ++i) {
 String var10000 = this.str[i];
 }

 }
 }



 */
public class ForAndForColon{
    String[] str={"1"};
    public void forColonDemo() {
        for (String strs:str) {

        }
    }
    public void forDemo() {
        for (int i = 0; i < str.length; i++) {
            String strs=str[i];
        }
    }

}
